package com.xdtech.hotel.service;

import java.util.List;
import java.util.Map;

import com.xdtech.common.service.IBaseService;
import com.xdtech.core.model.BaseItem;
import com.xdtech.hotel.model.Device;
import com.xdtech.hotel.vo.DeviceItem;
import com.xdtech.hotel.vo.RoomItem;
import com.xdtech.web.model.Pagination;

/**
 * 
 * @author max.zheng
 * @create 2015-04-04 11:06:39
 * @since 1.0
 * @see
 */
public interface DeviceService extends IBaseService<Device>{

	/**
	 * 保存更新信息
	 * @author max.zheng
	 * @create 2015-04-04 11:06:39
	 * @modified by
	 * @param item
	 * @return
	 */
	boolean saveOrUpdateDevice(DeviceItem item);

	/**
	 * 加载记录信息
	 * @author max.zheng
	 * @create 2015-04-04 11:06:39
	 * @modified by
	 * @param newId
	 * @return
	 */
	DeviceItem loadDeviceItem(Long deviceId);

	/**
	 * 根据id号删除记录信息
	 * @author max.zheng
	 * @create 2015-04-04 11:06:39
	 * @modified by
	 * @param id
	 * @return
	 */
	boolean deleteDeviceInfo(long id);

	/**
	 * 
	 * @author max.zheng
	 * @create 2015-04-04 11:06:39
	 * @modified by
	 * @param deviceIds
	 */
	boolean deleteDeviceInfo(List<Long> deviceIds);

	/**
	 * 
	 * @author max.zheng
	 * @create 2015-4-9下午11:44:50
	 * @modified by
	 * @param id
	 * @return
	 */
	DeviceItem getDeviceItemById(Long id);

	/**
	 * 检查设备名称、设备sn、设备ip是否已存在
	 * @author max.zheng
	 * @create 2015-4-14下午10:18:23
	 * @modified by
	 * @param deviceName
	 * @param deviceSn
	 * @param deviceIp
	 * @return
	 */
	List<Device> checkDeviceInfo(String deviceName, String deviceSn,
			String deviceIp);

	/**
	 * 根据设备ids判断是否被客房关联
	 * @author max.zheng
	 * @create 2015-4-17下午9:35:58
	 * @modified by
	 * @param deviceIds
	 * @return
	 */
	boolean checkAllowDel(List<Long> deviceIds);

	/**
	 * 自动添加设备信息
	 * @author max.zheng
	 * @create 2015-5-3下午4:08:30
	 * @modified by
	 * @param ip
	 * @param sn
	 */
	void addAutoAddDevice(String ip, String sn);

	/**
	 * 
	 * @author max.zheng
	 * @since 2015-5-5 下午1:46:55
	 * @param sn
	 * @return
	 */
	RoomItem getDeviceLinkRoomBySn(String sn);
}
